package chat;

import java.io.Serializable;

/**
 * Message package class for use in ACE4.
 * @author derykegan
 *
 */

public class Message implements Serializable{

	private String time, username, message;
	
	/**
	 * Create new message object.
	 * @param time - Time message was sent.
	 * @param username - Username of sender.
	 * @param message - Message text.
	 */
	public Message(String time,String username, String message){
		this.time = time;
		this.username = username;
		this.message = message;
	}
	
	/**
	 * Get the time the message was sent.
	 * @return
	 */
	public String getTime(){
		if(time != null)
			return time;
		else
			return "";
	}
	
	/**
	 * Get the username of the message sender.
	 * @return
	 */
	public String getUsername(){
		if(username != null)
			return username;
		else
			return "";
	}
	
	/**
	 * Get the message text sent.
	 * @return
	 */
	public String getMessageText(){
		if(message != null)
			return message;
		else
			return "";
	}
	
}
